package com.gnrsoft.springcloud.service.ribbon.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import com.gnrsoft.springcloud.service.ribbon.service.HelloService;

@RestController
public class HelloControler {
	
	@Autowired
	HelloService helloService;

	@RequestMapping(value = "/hi")
	public String hi(@RequestParam String name) {
		//http://localhost:8764/hi?name=ribbonTest
		System.out.println("ribbon");
		return helloService.hiService(name);
	}
	
	@RequestMapping(value = "/hello")
	public String hello() {
		System.out.println("say hello");
		return "hello";
	}
}
